<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Report extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        $this->load->model(array('report_model'));
        $infos = $this->input->get();
        $callback = $_GET['jsonpCallback'];
        //dd($infos);
//        $infos = json_decode($info,true);
//        dd($infos);
        $now = date('Y-m-d');
        $insert = array(
            'today' => $now,
            'stime' => $infos['stime'],
            'subtime' => $infos['subtime'],
            'errors' => json_encode($infos['errList']),
            'over' => $infos['allrighttime']
        );
        $id = $this->report_model->insert($insert);
        $res['code'] = 0;
        $res['msg'] = 'ok';
        echo $callback.'('.json_encode($res).')';
    }
}